import { useGoTo } from "@/hooks";
import { useUserContext } from "@/hooks/userHooks";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { ROUTE_KEY } from "@/routes/menus";
import { Button, Result } from "antd";
import { useEffect } from "react";

/**
 * 请选择门店
 */
const NoOrg = () => {
  const {store} = useUserContext()
  const {go} =useGoTo()
  useEffect(()=>{
    if(store.currentOrg){
      // go(ROUTE_KEY.ORG)
      go() //跳到首页
    }
  },[store.currentOrg])
  return (
    <Result
      status="404"
      title="请选择门店"
      subTitle="所有的管理行为都是基于您选择的门店进行筛选"
      extra={
        <Button type="primary" href="/home">
          返回首页
        </Button>
      }
    />
  );
};

export default NoOrg;
